package com.cdp.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cdp.common.core.domain.entity.SysSwellingagent;
import com.cdp.system.dto.SwellingagentDTO;
import com.cdp.system.mapper.SysSwellingagentMapper;
import com.cdp.system.service.ISysSwellingagentService;
import com.cdp.system.vo.SwellingagentVO;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class SysSwellingagentServiceImpl extends ServiceImpl<SysSwellingagentMapper, SysSwellingagent> implements ISysSwellingagentService {


    @Autowired
    private  SysSwellingagentMapper sysSwellingagentMapper;

    @Override
    public List<SwellingagentVO> querySysSwellingagent(SwellingagentDTO swellingagentDTO) {
        List<SysSwellingagent> swellingagentVOS  =sysSwellingagentMapper.querySysSwellingagent(swellingagentDTO);
        ArrayList<SwellingagentVO> arrayListVO = new ArrayList<>();
        for (SysSwellingagent swellingagentVO : swellingagentVOS) {
            SwellingagentVO vo = new SwellingagentVO();
            BeanUtils.copyProperties(swellingagentVO,vo);
            arrayListVO.add(vo);
        }

        return arrayListVO;
    }
}
